package com.jctrip.hotel.source.xxl.greentree;

import com.jctrip.hotel.common.constant.XxlJobNameConstant;
import com.jctrip.hotel.domain.dao.HtSourceInfoDao;
import com.jctrip.hotel.source.service.greentree.GreenTreeTaskService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author：Haruhi
 * @description:
 * @Date：2023/9/5 09:44
 * @Package：com.jctrip.hotel.source.xxl.greentree
 * @Project：hotel-main
 */
@Component
@Slf4j
public class SyncGreenTreeRatesTaskPushXxlJob extends IJobHandler {

    @Resource
    private GreenTreeTaskService greenTreeTaskService;

    @Override
    @XxlJob(XxlJobNameConstant.SYNC_GREENTREE_RATES_PUSH)
    public void execute() throws Exception {
        XxlJobHelper.log(XxlJobNameConstant.SYNC_GREENTREE_RATES_PUSH + "xxl job start");
        try {
            greenTreeTaskService.syncGreenTreeRatesTaskPush();
        } catch (Exception e) {
            log.error(XxlJobNameConstant.SYNC_GREENTREE_RATES_PUSH + "error ",e);
        }
        XxlJobHelper.log(XxlJobNameConstant.SYNC_GREENTREE_RATES_PUSH + "xxl job end");
    }
}
